package com.example.jpatest.unit;

import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class Result {
    private Object data;
    private String msg;
    private int code;

    public Result(Object data, String msg,int code) {
        this.data = data;
        this.msg = msg;
        this.code = code;
    }

    public static Result succ(Object data){
        return new Result(data,"成功",200);
    }

    public static Result succMsg(){
        return new Result(null,"成功",200);
    }

    public static Result msg(String info){
        return new Result(null,info,400);
    }
}
